﻿using System.Collections.Generic;
using ShopB2C.Entity;

namespace ShopB2C.Interfaces {
    /// <summary>
    /// 分类接口
    /// </summary>
    public interface IClassify {
        
        #region Class

        /// <summary>
        /// 获取指定模块类型的分类
        /// </summary>
        /// <param name="moduleKey">模块类型</param>
        /// <returns>List</returns>
        List<ClassifyEntity> GetClassifyByModuleKey(string moduleKey);
        /// <summary>
        /// 获取指定模块类型和指定父分类的分类
        /// </summary>
        /// <param name="moduleKey">模块类型</param>
        /// <param name="classifyId">id</param>
        /// <returns>List</returns>
        List<ClassifyEntity> GetClassifyByModuleKeyAndId(string moduleKey, int classifyId);
        /// <summary>
        /// 获取指定模块类型和指定父分类路径的所有父分类
        /// </summary>
        /// <param name="moduleKey">模块类型</param>
        /// <param name="path">路径</param>
        /// <returns>List</returns>
        List<ClassifyEntity> GetClassifyByModuleKeyAndPath(string moduleKey, string path);
        /// <summary>
        /// 获取指定模块类型和指定分类的所有子分类
        /// </summary>
        /// <param name="moduleKey">模块类型</param>
        /// <param name="classifyId">id</param>
        /// <returns>List</returns>
        List<ClassifyEntity> GetClassifyAllChildByModuleKeyAndId(string moduleKey, int classifyId);
        /// <summary>
        /// 获得指定 id 的分类
        /// </summary>
        /// <param name="classifyId">id</param>
        /// <returns>分类实例</returns>
        ClassifyEntity GetClassifyById(int classifyId);
        /// <summary>
        /// 添加分类
        /// </summary>
        /// <param name="ce">ClassifyEntity</param>
        void ClassifyAppend(ClassifyEntity ce);
        /// <summary>
        /// 更新分类
        /// </summary>
        /// <param name="ce">ClassifyEntity</param>
        void ClassifyUpdate(ClassifyEntity ce);
        /// <summary>
        /// 删除指定 id 的分类
        /// </summary>
        /// <param name="classifyId">id</param>
        void ClassifyDelete(int classifyId);
        /// <summary>
        /// 批量更新分类排序
        /// </summary>
        /// <param name="classifyIds">分类 id 集</param>
        /// <param name="sequences">排序集</param>
        void ClassifyBatchUpdateSequence(string classifyIds, string sequences);
        /// <summary>
        /// 获得指定 Name 和 ModuleKey 的分类
        /// </summary>
        /// <param name="name">分类 Name</param>
        /// <param name="moduleKey">模块关键字</param>
        /// <returns>分类实例</returns>
        ClassifyEntity GetClassifyByName(string name, string moduleKey);


        #endregion

        #region Property

        /// <summary>
        /// 添加新的分类特性
        /// </summary>
        /// <param name="cpe">ClassifyPropertyEntity</param>
        void PropertyAppend(ClassifyPropertyEntity cpe);
        /// <summary>
        /// 修改分类特性
        /// </summary>
        /// <param name="cpe">ClassifyPropertyEntity</param>
        void PropertyUpdate(ClassifyPropertyEntity cpe);
        /// <summary>
        /// 删除分类特性
        /// </summary>
        /// <param name="propertyIds">分类特性 id 字符串，“,”分隔</param>
        void PropertyDelete(string propertyIds);
        /// <summary>
        /// 获取指定 id 的分类特性
        /// </summary>
        /// <param name="propertyId">分类特性 id</param>
        /// <returns>ClassifyPropertyEntity</returns>
        ClassifyPropertyEntity GetPropertyById(int propertyId);
        /// <summary>
        /// 获取分类特性列表
        /// </summary>
        /// <param name="classifyId">分类 id</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="pageIndex">当前页号</param>
        /// <param name="pageSize">接收返回的总页数</param>
        /// <returns>List</returns>
        List<ClassifyPropertyEntity> GetPropertyByClassify(int classifyId, int pageSize, int pageIndex, out int pageCount);
        /// <summary>
        /// 批量更新分类特性排序
        /// </summary>
        /// <param name="propertyIds">分类特性 id 集</param>
        /// <param name="sequences">排序集</param>
        void PropertyBatchUpdateSequence(string propertyIds, string sequences);
        /// <summary>
        /// 复制特性
        /// </summary>
        /// <param name="propertyIds">分类特性 id 集</param>
        /// <param name="classifyId">分类 id</param>
        void PropertyCopy(string propertyIds, int classifyId);

        #endregion

        #region PropertyVal

        /// <summary>
        /// 添加新的分类特性值
        /// </summary>
        /// <param name="cpve">ClassifyPropertyValEntity</param>
        void PropertyValAppend(ClassifyPropertyValEntity cpve);
        /// <summary>
        /// 修改分类特性值
        /// </summary>
        /// <param name="cpve">ClassifyPropertyValEntity</param>
        void PropertyValUpdate(ClassifyPropertyValEntity cpve);
        /// <summary>
        /// 删除分类特性值
        /// </summary>
        /// <param name="propertyValIds">分类特性值 id 字符串，“,”分隔</param>
        void PropertyValDelete(string propertyValIds);
        /// <summary>
        /// 获取指定 id 的分类特性值
        /// </summary>
        /// <param name="propertyValId">分类特性值 id</param>
        /// <returns>ClassifyPropertyValEntity</returns>
        ClassifyPropertyValEntity GetPropertyValById(int propertyValId);
        /// <summary>
        /// 获取分类特性值列表
        /// </summary>
        /// <param name="propertyId">分类特性 id</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="pageIndex">当前页号</param>
        /// <param name="pageSize">接收返回的总页数</param>
        /// <returns>List</returns>
        List<ClassifyPropertyValEntity> GetPropertyValByProperty(int propertyId, int pageSize, int pageIndex, out int pageCount);
        /// <summary>
        /// 批量更新分类特性值排序
        /// </summary>
        /// <param name="propertyValIds">分类特性值 id 集</param>
        /// <param name="sequences">排序集</param>
        void PropertyValBatchUpdateSequence(string propertyValIds, string sequences);

        #endregion
    }
}
